package com.dapeng.cleardatabackend.model.vo;

import com.dapeng.cleardatabackend.model.entity.Node;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * @author dapeng
 * @description 图谱节点VO
 * @date 2024/12/22 22:44
 */
@Data
@ApiModel(description = "图谱节点VO")
public class NodeVO implements Serializable {

    private static final long serialVersionUID = 431319699180079952L;

    /**
     * 节点id
     */
    @ApiModelProperty(value = "节点id")
    private Long id;

    /**
     * 节点id
     */
    @ApiModelProperty(value = "节点id")
    private String nodeId;

    /**
     * 节点标签
     */
    @ApiModelProperty(value = "节点标签")
    private String label;

    /**
     * 节点文本
     */
    @ApiModelProperty(value = "节点文本")
    private String text;

    /**
     * 对象转视图
     *
     * @param node node
     * @return {@link NodeVO }
     */
    public static NodeVO beanToVo(Node node) {
        NodeVO nodeVO = new NodeVO();
        BeanUtils.copyProperties(node, nodeVO);
        return nodeVO;
    }
}
